package com.diandi.ddsb.bean;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;

/**
 * @author yaojunbing
 */
public class Results implements Serializable {
	/**
	 * @author yaojunbing
	 * @since 2015年12月20日
	 */

	private static final long serialVersionUID = -2864995532153225492L;
	/**
	 * 操作code
	 */
	private int code;
	/**
	 * 返回提示信息
	 */
	private String msg;
	/**
	 * 返回实体，可包含各种信息
	 */
	private Object obj;

	public Results() {
		super();

	}

	/**
	 * @param code
	 * @param msg
	 */
	public Results(int code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}

	/**
	 * @param code
	 * @param msg
	 * @param obj
	 */
	public Results(int code, String msg, Object obj) {
		super();
		this.code = code;
		this.msg = msg;
		this.obj = obj;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Results [code=");
		sb.append(code);
		sb.append(", msg=");
		sb.append(msg);
		sb.append(", obj=");
		sb.append(JSON.toJSONString(obj));
		sb.append("]");
		return sb.toString();
	}

}
